package com.nsoft.remotemedia;

import com.nsoft.remotemedia.utils.Constant;

import android.os.Bundle;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.view.Menu;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

@SuppressWarnings("deprecation")
public class RemoteActivity extends TabActivity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_remote);
		
		createTabs();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.remote, menu);
		return true;
	}

	private void createTabs(){
		Resources ressources=getResources(); 
		TabHost tabHost=getTabHost();
		
		TabSpec u2bTab=tabHost.newTabSpec(
					Constant.main.TEXT_TAB_YOUTUBE);
		u2bTab.setIndicator(Constant.main.TEXT_TAB_YOUTUBE, 
				ressources.getDrawable(R.drawable.ic_u2b));
        Intent u2bIntent=new Intent(this,U2bActivity.class);
        u2bTab.setContent(u2bIntent);
 
        TabSpec fileTab=tabHost.newTabSpec(
        		Constant.main.TEXT_TAB_FILEEXPLORER);
        fileTab.setIndicator(Constant.main.TEXT_TAB_FILEEXPLORER,
        		ressources.getDrawable(R.drawable.ic_file));
        Intent fileIntent=new Intent(this,FileExplorerActivity.class);
        fileTab.setContent(fileIntent);
        
        tabHost.addTab(u2bTab);
        tabHost.addTab(fileTab);
	}
}
